﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DNHundredUser : MonoBehaviour
{

    public UILabel goldLabel;
    public UISprite avatar;
    public GameObject avatarBtn;
    public int uid;
    public UITexture wxAvatar;
    //public DN100UserInfo dn100UserInfo;
    
    void Awake()
    {
        UIEventListener.Get(avatarBtn).onClick = ButtonClick;
    }

    void ButtonClick(GameObject button)
    {
        if(button.name == "Avatar"){
            if(uid != 0){
                GameObject userInfo = NGUITools.AddChild(GameObject.Find("UI Root"), (GameObject)Resources.Load(GameDN100PrefabPath.DN100UserInfo));
                DN100UserInfo dn100UserInfo = userInfo.GetComponent<DN100UserInfo>();
                dn100UserInfo.LoadUserInfo(uid);
                dn100UserInfo.uid = uid;
                Debug.Log("座椅上的玩家的uid = " + uid);
            }
           
        }
    }
}	
